package com.example.taobaounion.model;

import com.example.taobaounion.model.bean.Categories;
import com.example.taobaounion.model.bean.HomePagerContent;
import com.example.taobaounion.model.bean.OnSellContent;
import com.example.taobaounion.model.bean.SearchRecommend;
import com.example.taobaounion.model.bean.SearchResult;
import com.example.taobaounion.model.bean.SelectContent;
import com.example.taobaounion.model.bean.SelectedPageCategory;
import com.example.taobaounion.model.bean.TickParams;
import com.example.taobaounion.model.bean.TicketResult;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

public interface Api {

    //get请求分类数据
    @GET("discovery/categories")
    Call<Categories> getCategories();

    //get请求分类详情数据，接口带参数(请求路径带参数)
    @GET
    Call<HomePagerContent> getHomePageContent(@Url String url);//Url-请求路径

    //post请求淘口令
    @POST("tpwd")
    Call<TicketResult> getTicket(@Body TickParams ticketParams);//Body 用于post提交数据时的body

    //get获取精选分类
    @GET("recommend/categories")
    Call<SelectedPageCategory> getSelectedPageCategories();


    //get获取精选分类的内容
    @GET
    Call<SelectContent>  getSelectedPageContent(@Url String url);

    //get获取特惠内容
    @GET
    Call<OnSellContent> getOnSellPageContent(@Url String url);

    //get获取搜索热词
    @GET("search/recommend")
    Call<SearchRecommend> getRecommendWords();

    @GET("search")
    Call<SearchResult> doSearch(@Query("page") int page,@Query("keyword") String keyword);

}
